<template>
	<el-divider border-style="dashed" content-position="left">
		<div class="divider-content">
			<icon v-if="showIcon" :name="props.icon" size="var(--el-font-size-large)"/>
			<span :style="labelStyle" class="label">{{ props.label }}</span>
			<slot name="after"></slot>
		</div>
	</el-divider>
</template>

<script lang="ts" setup>
import Icon from '@/components/icon.vue'
import type {StyleValue} from 'vue'

const props = withDefaults(defineProps<{
	label?: string
	labelStyle?: StyleValue
	icon?: string
	showIcon?: boolean
}>(), {
	icon: 'fa fa-table',
	showIcon: true
})

</script>

<style lang="scss" scoped>

.divider-content {
	display: flex;
	align-items: center;

	.label {
		font-size: var(--el-font-size-large);
		font-weight: bold;
		margin-left: 10px;
	}
}

</style>
